﻿using System.Resources;
using System.Threading;

namespace PMS.Resources
{
  public static class Messages
  {

    private static ResourceManager resourceManager =
      new ResourceManager("PMS.Resources.Messages", typeof(Messages).Assembly);

        public static string GetString(string resourceKey)
        {
            if (string.IsNullOrEmpty(resourceKey))
                return resourceKey;

            var str = resourceManager.GetString(resourceKey, Thread.CurrentThread.CurrentUICulture);
            
            if (string.IsNullOrEmpty(str))
                return resourceKey;

            return str;
        }
    }
}
